// 引入地址、端口、一级路由
import {
  address,
  pathApi
} from "@/api/path";
// 引入 axios
import axios from "axios";
// 修改密码
const updatePwd = (condition, callback) => {
  condition.loginType = 2;
  axios({
    data: {
      userId: condition.userId, //用户id  
      cPassWord: condition.cPassWord, //原密码  
      passWord: condition.passWord //新密码
    },
    method: "post",
    headers: {
      "Content-Type": "application/json"
    },
    url: `${address}${pathApi}/user/updatePWD`
  }).then(function (res) {
    callback(res.data)
  });
}
// 意见反馈
const feedBack = (condition, callback) => {
  axios({
    data: {
      opinion: condition.opinion, //  意见内容
      createUser: condition.createUser, //反馈人名称
    },
    method: "post",
    headers: {
      "Content-Type": "application/json"
    },
    url: `${address}${pathApi}/opinion/addOpinion`
  }).then(function (res) {
    callback(res.data)
  });
}
// 头像上传
const uploadImg = (condition, callback) => {
  axios({
    data: {
      file: condition //新密码
    },
    method: "post",
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    headers: {
      "Content-Type": "application/json"
    },
    url: `${address}${pathApi}/login/findAccount`
  }).then(function (res) {
    callback(res.data)
  });
}
// 退出登录
// const quitLogin = (condition, callback) => {
//   axios({
//     data: {
//       file: condition //新密码
//     },
//     method: "post",
//     headers: {
//       'Content-Type': 'multipart/form-data'
//     },
//     headers: {
//       "Content-Type": "application/json"
//     },
//     url: `${address}${pathApi}/login/loginOutApp`
//   }).then(function (res) {
//     callback(res.data)
//   });
// }
export {
  feedBack,
  updatePwd,
  uploadImg,
}
